#!/bin/bash
#mysql --execute=' show variables like "max_connections";'
con_no=`mysql --execute=' show variables like "max_connections";' |grep max_|awk '{print $2}'`
if [ $con_no -lt 2000 ]
then
  echo "---------------------------------------------------"
  date +%Y-%m-%d\ %T
  echo "max_connections is $con_no,  not more than 2000 change to 2000:"
  mysql --execute=' set GLOBAL max_connections=2000; '
  echo "Done"
fi
